Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #7593: disableKeyboardNavigation prop for Tree component #7588

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

CorentinAT
Copy link

@CorentinAT CorentinAT commented Jan 9, 2025

Fix #7593: disableKeyboardNavigation prop for Tree component

[Small feature]
Added a "keyboardKeyboardNavigation" to prevent expansion and collapse with arrow keys, and all key navigation (enter, tab, space, arrows)

Copy link

vercel bot commented Jan 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Updated (UTC)
primereact ⬜️ Ignored (Inspect) Visit Preview Jan 9, 2025 3:40pm
primereact-v9 ⬜️ Ignored (Inspect) Visit Preview Jan 9, 2025 3:40pm

Copy link

github-actions bot commented Jan 9, 2025

Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>.

@CorentinAT CorentinAT closed this Jan 9, 2025
@CorentinAT CorentinAT reopened this Jan 9, 2025
Copy link

github-actions bot commented Jan 9, 2025

Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>.

@CorentinAT CorentinAT changed the title disableKeyboardNavigation prop for Tree component feat(Tree): disableKeyboardNavigation prop for Tree component Jan 9, 2025
Copy link

github-actions bot commented Jan 9, 2025

Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>.

@CorentinAT CorentinAT changed the title feat(Tree): disableKeyboardNavigation prop for Tree component Feat: disableKeyboardNavigation prop for Tree component Jan 9, 2025
Copy link

github-actions bot commented Jan 9, 2025

Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>.

@melloware melloware added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Jan 10, 2025
@melloware
Copy link
Member

I am not sure why you would want this as PrimeReact aims to be WCAG/ARIA compliant for components this essentially turns that off so I am -1 on this feature.

@melloware melloware added the Status: Discussion Issue or pull request needs to be discussed by Core Team label Jan 10, 2025
@CorentinAT
Copy link
Author

CorentinAT commented Jan 10, 2025

For example, I'm working on using the component where you can change the name of a node thanks to an input texte that appears in place of the node name. So i want to deactivate temporarily the key navigation.
But you can't move from right to left in the input because it activates the tree controls.
I think the feature would be interesting for this type of situation where you want to do other manipulations inside the tree.

image

For WCAG/ARIA, it is only a property manually assigned by the developer (and I think it's good to give the developer the freedom to decide where to apply the WCAG/ARIA principles)

@melloware
Copy link
Member

OK if that is your use case then you should check event.currentTarget and if its an input or select

const isInputTarget= (event) => {
    return event.currentTarget.matches('input, select');
};

If so then in the onArrowDown etc check if its an isInputTarget and return;

@melloware
Copy link
Member

also please open a ticket first with your scenario.

@CorentinAT
Copy link
Author

Ok thank you very much I didn't know this at all, I'm trying this afternoon. I quickly open a ticket

@melloware melloware changed the title Feat: disableKeyboardNavigation prop for Tree component Fix #7593: disableKeyboardNavigation prop for Tree component Jan 10, 2025
Copy link

Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Discussion Issue or pull request needs to be discussed by Core Team Status: Pending Review Issue or pull request is being reviewed by Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tree: can't use keyboard inputs for tree sub component
2 participants